/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package it.apuliait.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.liferay.portal.kernel.exception.SystemException;

import it.apuliait.model.LineaFattura;
import it.apuliait.service.base.LineaFatturaLocalServiceBaseImpl;

/**
 * The implementation of the linea fattura local service.
 *
 * <p>
 * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.apuliait.service.LineaFatturaLocalService} interface.
 *
 * <p>
 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
 * </p>
 *
 * @author Donatello
 * @see it.apuliait.service.base.LineaFatturaLocalServiceBaseImpl
 * @see it.apuliait.service.LineaFatturaLocalServiceUtil
 */
public class LineaFatturaLocalServiceImpl
	extends LineaFatturaLocalServiceBaseImpl {
	
	public List<LineaFattura> getCompetenze(long documentoId)
	{
		List<LineaFattura> competenze = new ArrayList<LineaFattura>();
		try {
			competenze = getLineaFatturaPersistence().findByCompetenze(documentoId);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SystemException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return competenze;
	}
	
	public List<LineaFattura> getCompetenzeForDDT(long documentoId, String numeroDdt, String dataDdt)
	{
		List<LineaFattura> competenze = new ArrayList<LineaFattura>();
		try {
			competenze = getLineaFatturaPersistence().findByCompetenzeForDDT(documentoId, numeroDdt, dataDdt);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SystemException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return competenze;
	}
	
}